<template>
  <div class="div1">
    <van-row>
      <van-col span="8"><router-link to="/set"><van-icon name="arrow-left" />设置</router-link></van-col>
      <van-col span="8">我的收藏</van-col>
      <van-col span="8"></van-col>
    </van-row>
  </div>
  <div>

    <div v-for="a in activitys">
      <div class="div2" @click="hopp(a.id)">
        <van-row>
          <img class="img1" :src="a.imgurl">
          <p class="p1">{{ a.title }}</p>
        </van-row>
      </div>

    </div>

  </div>
</template>

<script>
export default {
  name: "CollectView",
  data() {
    return {
      activitys:[

      ]
    }
  },methods:{
    select(){
      this.axios.get("/api/collect/selectAll.do").then(r=>{
        if(r.data.code==200){
          //成功
          this.activitys=r.data.data;
        }
      });
    },
    hopp(id){
      this.$router.push({path:'/hopp',query:{id:id}})
      //this.$router.push("/hopp");
    }

  },mounted() {
      this.select()
  }
}
</script>

<style scoped>
.div1{
  margin-top: 30px;
  margin-bottom: 20px;
}
.div2{
  margin-left: 40px;
  margin-right: 40px;
  margin-top: 20px;
  border:2px solid;
  border-radius:5px;
}
.img1{
  width: 50px;
  height: 50px;
  border-radius:5px;
}
.p1{
  margin-left: 40px;
  font-size: 15px;
  font-weight:bolder;
}
</style>